function CreateLabel( posx, posy, text, font, parent, name )

	local name = vgui.Create("DLabel", parent)
		name:SetText( text )
		name:SetFont( font )
		name:SizeToContents()
		
		if posx == "center" then posx = (parent:GetWide() / 2) - (name:GetWide() / 2) end
		name:SetPos( posx, posy )
		name:SetVisible(true)
		
	return name
		
end

function CreateButton( posx, posy, sizex, sizey, text, onclick, hoverenter, hoverexit, parent, name )

	if parent != nil then 
		name = vgui.Create("DButton", parent)
	else
		name = vgui.Create("DButton")
	end
	
		name:SetText( text )
		name:SetSize( sizex, sizey )
		if posx == "center" then posx = (parent:GetWide() / 2) - (name:GetWide() / 2) end
		name:SetPos( posx, posy )
		
		name.DoClick = onclick
		name.OnCursorEntered = hoverenter
		name.OnCursorExited = hoverexit
		
	return name
	
end

function CreateModelImg( posx, posy, model, parent, name )

	local name = vgui.Create("ModelImage", parent)
		name:SetModel(model)
		name:SetPos( posx, posy )
		name:SetSize( 64, 64 )
		
	return name
		
end

function CreatePanel( posx, posy, sizex, sizey, color, parent, name )

	if parent != nil then 
		name = vgui.Create("DPanel", parent)
	else
		name = vgui.Create("DPanel")
	end

		name:SetSize( sizex, sizey )
		name:SetPos( posx, posy )
		name.Paint = function()
			surface.SetDrawColor( color.r, color.g, color.b, color.a )
			surface.DrawRect( 0, 0, name:GetWide(), name:GetTall() )
		end
		
	return name
	
end

function CreateList( posx, posy, sizex, sizey, spacing, scrollbar, parent, name )

	if parent != nil then 
		name = vgui.Create("DPanelList", parent)
	else
		name = vgui.Create("DPanelList")
	end
	
	name:SetPos( posx, posy )
	name:SetSize( sizex, sizey)
	name:SetSpacing(spacing)
	name:EnableHorizontal(false)
	name:EnableVerticalScrollbar(scrollbar)
	
	return name
	
end

function CreateComboBox( posx, posy, sizex, sizey, parent, name )

	if parent != nil then
		name = vgui.Create("DComboBox", parent)
	else
		name = vgui.Create("DComboBox")
	end
	
	name:SetPos( posx, posy )
	name:SetSize( sizex, sizey )
	name:SetMultiple( false )
	
	return name
	
end

function CreatePropertySheet( posx, posy, sizex, sizey, parent, name )

	local name = vgui.Create( "DPropertySheet" )
		name:SetParent( parent )
		name:SetPos( posx, posy )
		name:SetSize( sizex, sizey )
	
	return name
	
end

function CreateCollapsCategory( posx, posy, sizex, sizey, label, expanded, parent, name ) 

	if parent != nil then
		name = vgui.Create("DCollapsibleCategory", parent)
	else
		name = vgui.Create("DCollapsibleCategory")
	end
	
	name:SetPos( posx, posy )
	name:SetSize( sizex, sizey )
	name:SetExpanded( expanded )
	name:SetLabel( label )
	
	return name
	
end

function CreateImage( posx, posy, img, parent, name )

	name = vgui.Create( "DImage", parent )
	
	if posx == "center" then posx = (parent:GetWide() / 2) - (name:GetWide() / 2) end
	name:SetPos(posx, posy)
	name:SetImage( img )
	name:SizeToContents()
	
	return name
	
end

function CreateTextEntry( posx, posy, sizex, sizey, enter, onenter, parent, name )

	name = vgui.Create( "DTextEntry", parent )
	
	name:SetPos( posx, posy )
	name:SetSize( sizex, sizey )
	name:SetEnterAllowed( enter )
	
	name.OnEnter = onenter
	
	return name
	
end

function CreateModelPanel( posx, posy, sizex, sizey, model, animated, fov, parent, name )

	name = vgui.Create( "DModelPanel", parent )
	
	name:SetPos( posx, posy )
	name:SetSize( sizex, sizey )
	name:SetModel( model )
	name:SetAnimated( true )
	name:SetAnimSpeed( 1 )
	name:SetFOV( fov )
	
	return name
	
end